package com.cloudkinto.service.stock;

import com.cloudkinto.entity.StockLogDo;
import com.baomidou.mybatisplus.extension.service.IService;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.service.stock.vo.log.StockLogPageRes;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  service接口
 * </p>
 * @author 张永远
 * @since 2020-06-10
 */
public interface StockLogService extends IService<StockLogDo> {

    SingleResult pageInit(Long c,Long u);


    PageResult getListPage(Map<String, String> map);

    boolean saveAutoSendOutLog(Integer status, Long productId, Long shopId, Long storageId, int count, Integer afterCount, Long companyId, Long userId, String orderNo);

    boolean saveAutoSendOutLog(Integer status, Long productId, Long shopId, Long storageId, int count, Integer afterCount, Long companyId, Long userId, String orderNo, Long flowingId);

    List<StockLogPageRes> getList(Map<String, String> map);

    boolean saveAutoSendOutLog(Long productId, Long shopId, Long storageId, int count, Integer afterCount, Long companyId, Long userId, String orderNo);

    /**
     * 获取多少天内的入库数量
     * @param storageId  所在仓库
     * @param shopId 所属店铺
     * @param productInfoId SKU
     * @param commoditySku
     * @param beforeDays 开始日期
     * @return
     */
    int selectInCount(Long storageId, Long shopId, Long productInfoId, String commoditySku, int beforeDays);

    int selectLogCount(Long storageId, Long shopId, Long productInfoId, String commoditySku, int type, String startDate, String endDate);

    Object exportExcel(Map<String, String> map, String fileName);
}
